<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./axios.min.js"></script>
</head>
<body>
    <button id="btn">
        我是一个按钮
    </button>

    <script>
        const btn = document.querySelector('#btn')

        btn.onclick = async  function(){
           try{
            const re = await axios({
                url:'/user',
                method :'post',
                headers:{},
                //跟随url参数一起的数据
                params:{
                    userid:'yinwei'
                },
                data:{

                },
                timeout:10000
           })

           console.log(re);
           }catch(e){
            console.log(e.message);
           }
        }
    </script>
</body>
</html>